obj=read-records-alloc write-records

all:$(obj)

prebuild: write-record.s read-record.s \
	write-newline.s count-chars.s alloc_64.s
	as -g alloc_64.s -o alloc_64.o
	as -g write-record.s -o write-record.o
	as -g read-record.s -o read-record.o
	as -g write-newline.s -o write-newline.o
	as -g count-chars.s -o count-chars.o

read-records-alloc: prebuild read-records-alloc.s
	as -g read-records-alloc.s -o read-records-alloc.o
	ld alloc_64.o read-records-alloc.o read-record.o \
	write-newline.o count-chars.o -o read-records-alloc

write-records: write-records.s prebuild
	as -g write-records.s -o write-records.o
	ld write-records.o write-record.o write-newline.o \
	-o write-records

clean:
	-rm *.o $(obj)
